#define PIN_R 0
#define PIN_G 4
#define PIN_B 12

void RGB_init();
void RGB_show(int r, int g, int b);
int fillter_rgb_int(int x);

void RGB_init()
{
  pinMode(PIN_R, OUTPUT);
  pinMode(PIN_G, OUTPUT);
  pinMode(PIN_B, OUTPUT);
  RGB_show(0, 0, 0);
}
void RGB_show(int r, int g, int b)
{
  analogWrite(PIN_R, fillter_rgb_int(r));
  analogWrite(PIN_G, fillter_rgb_int(g));
  analogWrite(PIN_B, fillter_rgb_int(b));
}
int fillter_rgb_int(int x)
{
  if (x < 0)
  {
    return 0;
  }
  else if (x > 255)
  {
    return 255;
  }
  else
  {
    return x;
  }
}